import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            path: '/login',
            component: () => import('@/views/Login.vue')
        },
        {
            path: '/system',
            component: () => import('@/views/index.vue'),
            children: [
                {
                    path: '/system/',
                    redirect: '/system/home'
                },
                {
                    path: '/system/home',
                    component: () => import('@/views/Home.vue')
                },
                {
                    path: '/system/orderdetail',
                    component: () => import('@/views/OrderDetail.vue')
                },
                {
                    path: '/system/goods',
                    component: () => import('@/views/Goods.vue')
                },
                {
                    path: '/system/product',
                    component: () => import('@/views/Product.vue')
                },
                {
                    path: '/system/refund',
                    component: () => import('@/views/Refund.vue')
                },
                {
                    path: '/system/user',
                    component: () => import('@/views/User.vue')
                },
            ]
        },

    ]
})

export default router
